<?php
// +----------------------------------------------------------------------
// | OneThink [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.onethink.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: 麦当苗儿 <zuojiazi@vip.qq.com> <http://www.zjzit.cn>
// +----------------------------------------------------------------------

namespace Home\Controller;
use OT\DataDictionary;

/**
 * 前台首页控制器
 * 主要获取首页聚合数据
 */
class IntroduceController extends HomeController
{

    public function index()
    {
		$category = new \Document\Model\ContentArticle\Home\GetIntroduceCategoryModel();
        $category_list = $category->get();
		
		$this->assign('category_list', $category_list);
		
		
		$document=D('Document');
		$type_id=I('get.id');
		
	
		if(empty($type_id)){
			
			$where['id']=$category_list[0]['id'];
			$brand=$document->where($where)->field('title , id , model_id')->order('level asc ')->limit(1)->select();
			$contentArticle=D('DocumentContentArticle');
			$condition['id']=$brand[0]['id'];
			$content=$contentArticle->where($condition)->select();
			
		}else{
			$where['id']=$type_id;
			$brand=$document->where($where)->field('title , id , model_id')->select();
			$document_article=D('DocumentContentArticle');
			$confition['id']=$brand[0]['id'];
			
			$content=$document_article->where($confition)->field('content')->select();
		}
		$this->assign('type_id',$type_id);
		$this->assign('brand', $brand);
		$this->assign('content', $content);
		$model_id= $brand[0]['model_id'];
		
		
        $this->display('index');
		
    }
	
	  public function team()
    {
		$category = new \Document\Model\ContentArticle\Home\GetIntroduceCategoryModel();
        $category_list = $category->get();
		$this->assign('category_list', $category_list);
		
		$carousel = new \Document\Model\Carousel\Home\GetIntroduceCarouselModel();
		$team_carousel= $carousel->get();
		
		$this->assign('team_carousel', $team_carousel);	
		 $this->display('team');	
    }
	
	 public function development()
	{
		$category = new \Document\Model\ContentArticle\Home\GetIntroduceCategoryModel();
        $category_list = $category->get();
		$this->assign('category_list', $category_list);

		$category_list = $category->get();
        $this->display('development');
    }
	
	/*  public function chairman()
    {
		$category_list=$this->type_list();
		$this->assign('category_list', $category_list);
		
		
		$document=D('Document');
		$where['category_id']=40;
		$where['status']=1;
		$where['model_id']=7;
		$brand=$document->where($where)->field('title , id')->limit(1)->select();
		
		$document_article=D('DocumentContentArticle');
		$confition['id']=$brand[0]['id'];
		
		$content=$document_article->where($confition)->field('content')->select();
				var_dump($content);
		$this->assign('content', $content);
        $this->display('chairman');
    }
	
	  public function development()
    {
		$category_list=$this->type_list();
		$this->assign('category_list', $category_list);
        $this->display('development');
    }*/

 

}